﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LabyCLI
{
    public partial class frmTestLayout : Terminal
    {
        public frmTestLayout()
        {
            InitializeComponent();

            var window = pnl_WindowHolder.Controls.Find("Window", true).FirstOrDefault() as RichTextBox;
            //SetCurrentTerminal((RichTextBox)Controls[0]); TODO, Look at this.

            SetCurrentTerminal(window);

            SetAutoCompleteMenu(autocompleteMenu);
            ChangeAutoComplete AutoComplete = new ChangeAutoComplete();
            AutoComplete.SetChange(GetAutoCompleteMenu());

            LoadSettings();
        }

        void LoadSettings()
        {
            this.Size = Properties.Settings.Default.Terminal_FormSize;
            this.BackColor = Properties.Settings.Default.Terminal_BackgroundColor;
            txtbox_TerminalName.BackColor = Properties.Settings.Default.Terminal_BackgroundColor;
            GetCurrentTerminal().BackColor = Properties.Settings.Default.Terminal_BackgroundColor;
            GetCurrentTerminal().ForeColor = Properties.Settings.Default.Terminal_TextColor;
            GetCurrentTerminal().WordWrap = Properties.Settings.Default.Terminal_WordWrap;
            GetCurrentTerminal().Font = Properties.Settings.Default.Terminal_Font;
            menuStrip.Visible = Properties.Settings.Default.LabyCLI_ShowMenuBar;

            if (!Properties.Settings.Default.LabyCLI_ShowMenuBar)
            {
                showMenuBarToolStripMenuItem.Text = "Show menu bar";
            }
            else
            {
                showMenuBarToolStripMenuItem.Text = "Hide menu bar";
            }
        }

        #region Menustrip - TERMINAL

        private void ToolStripMenuItem_Preferences_Click(object sender, EventArgs e)
        {
            var frm = new frmSettings();
            frm.ShowDialog();
        }

        private void ToolStripMenuItem_ShowTaskManager_Click(object sender, EventArgs e)
        {

        }

        private void ToolStripMenuItem_About_Click(object sender, EventArgs e)
        {
            var frm = new frmAbout();
            frm.ShowDialog();
        }

        #endregion
    }
}
